import { axios } from '@/utils/request'

/**
 * 查询所有客户
 */
export function selectAllCustomer (code) {
  const parameter = {}
  if (code != undefined) {
    parameter.code = code
  }
  return axios({
    url: '/mqpay/customer/selectAllCustomer',
    method: 'post',
    params: parameter
  })
}

export function selectPage (parameter) {
  return axios({
    url: '/mqpay/customer/selectPage',
    method: 'post',
    params: parameter
  })
}

export function saveOrUpdate (parameter) {
  return axios({
    url: '/mqpay/customer/saveOrUpdate',
    method: 'post',
    data: parameter
  })
}

export function del (parameter) {
  return axios({
    url: '/mqpay/customer/' + parameter + '/delete',
    method: 'get'
  })
}

export function refreshApi (parameter) {
  return axios({
    url: '/mqpay/customer/' + parameter + '/refreshApi',
    method: 'get'
  })
}

export function getUseableAmount (parameter) {
  return axios({
    url: '/mqpay/customer/' + parameter + '/getUseableAmount',
    method: 'get'
  })
}

export function createCustomerFlow (parameter) {
  return axios({
    url: '/mqpay/customer/createCustomerFlow',
    method: 'post',
    params: parameter
  })
}
